package com.zzw.mapper;

import com.zzw.entity.Purchase;
import com.zzw.page.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Project: warehouse
 * @Description: 采购接口
 * @Author: zzw
 */
public interface PurchaseMapper {

    // 添加采购单
    int insertPurchase(Purchase purchase);

    // 查询采购单总行数
    int selectPurchaseCount(Purchase purchase);

    // 分页查询采购单
    List<Purchase> selectPurchasePage(@Param("page") Page page, @Param("purchase") Purchase purchase);

    // 根据id修改采购单
    int updatePurchaseById(Purchase purchase);

    // 根据id删除采购单
    int deletePurchaseById(Integer buyId);

    // 根据id将采购单状态改为已入库
    int updateIsInById(Integer buyId);

    // 根据id修改预计采购数量和实际采购数量
    int setNumById(Purchase purchase);
}
